/**
 * 
 */
package messaage;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;


/**
 * @author Olga
 * 
 */
public class AddedForumMsg extends Message {

	protected String forumID;
    protected String subject;
    protected String friendship;
    protected String username;

	/**
	 * 
	 */
	public AddedForumMsg(String whoAddedMsg, String forumID, String subject, String friendship) {
		this.username = whoAddedMsg;
		this.forumID = forumID;
        this.subject = subject;
        this.friendship = friendship;
        this.type = "AddedForumMsg";
	}



	/*
	 * (non-Javadoc)
	 * 
	 * @see messaage.Message#toString()
	 */
	@Override
	public String toString() {
		XStream xstream = new XStream(new DomDriver());
		String xml = xstream.toXML(this)+"\0";
		
		return xml;
	}

    public int getForumID() {
        return Integer.parseInt(forumID);
    }

    public String getSubject() {
        return subject;
    }

    public boolean isFriend(){
        return this.friendship.equalsIgnoreCase("true");
    }
    public String getUsername() {
        return this.username;
    }

}
